Repository navigation
Populate ClientLibraryName Field - #286
Merged
Merged
Conversation
rluong003
approved these changes
Oct 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The M3 reporter now sends the client library name
oss_go_tallyin each metric batch. The M3collector uses this field to identify which client library sent the metrics.
Changes
m3/thrift/v2/v2.thrift: add3: optional string clientLibraryNametoMetricBatch.m3/thrift/v2/ttypes.go: regenerate with Thrift 0.9.3, the same compiler version as theexisting generated code.
m3/thrift/thrift.diff: update theMetricBatchstruct hunk so thatmake gen-thriftstillreproduces the generated files.
m3/reporter.go: add the exported constantClientLibraryName = "oss_go_tally". The reportersets it on every batch. It is also set on the batch that
NewReporteruses to calculate packetoverhead, so the packet size limit includes the field.
The field is optional. Code that builds its own
MetricBatchdoes not send the field unless itsets it.
Compatibility
Readers that do not know field 3 skip it. A collector in strict mode rejects unknown fields, so
the collector must support field 3 before services pick up this version.
Testing
make testpasses.TestReporterchecks that each decoded batch containsoss_go_tally, for binary and compactprotocol.
TestMetricBatchClientLibraryNameRoundTripwrites and reads a batch with thefield set and unset, for both protocols.
thrift.diffreproduces the committed generated files exactly.